Check for mlock()
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 8 Sep 2020 16:50:39 +0000 (17:50 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 8 Sep 2020 22:50:12 +0000 (23:50 +0100)
We use it in the secure memory allocator, if it's available.

config.h.meson
meson.build

index f6a0ea0187e6469cfb9485ddbc6863b7595d0bdf..1968bb9cbeda18991e2a8068badd022cfdd9daba 100644 (file)
@@ -69,6 +69,9 @@
 /* Define to 1 if you have the `mkstemp' function. */
 #mesondefine HAVE_MKSTEMP
 
+/* Define to 1 if you have the `mlock` function. */
+#mesondefine HAVE_MLOCK
+
 /* Define to 1 if you have a working `mmap' system call. */
 #mesondefine HAVE_MMAP
 
index 88b3e7c0d5796e7165d9042c54f7eb814fd7a657..aa1b6e5c770c8c6ba52bbb32a444585963f417ed 100644 (file)
@@ -217,6 +217,11 @@ if cc.compiles(uint128_t_src, name : '__uint128_t available')
   cdata.set('HAVE_UINT128_T', 1)
 endif
 
+# Check for mlock
+if cc.has_function('mlock', prefix: '#include <sys/mman.h>')
+  cdata.set('HAVE_MLOCK', 1)
+endif
+
 # Disable deprecation checks for all libraries we depend on on stable branches.
 # This is so newer versions of those libraries don't cause more warnings with
 # a stable GTK version.